fix(formatter): correctly handle empty list responses from API#540
fix(formatter): correctly handle empty list responses from API#540dumko2001 wants to merge 3 commits intogoogleworkspace:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 58a8563 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where empty list responses from the API were not formatted intuitively. By adjusting the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue with formatting empty list responses from the API. The change modifies extract_items to return arrays even when they are empty, which allows downstream formatting logic to correctly handle these cases. A test has been updated to assert the new, correct behavior for table formatting, which now outputs (empty) for such responses. The changes appear to correctly fix the described issue.
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request correctly addresses the issue of handling empty list responses from the API. The modification in extract_items to allow empty arrays to be returned, combined with the updated test case, ensures that empty responses are now properly formatted as (empty) instead of a confusing metadata table. The changes are focused and directly resolve the described problem.
Description
Correctly identify and format empty API responses as
(empty)instead of showing a confusing metadata table. This is achieved by allowingextract_itemsto return empty arrays, which triggers the proper list formatting logic.Checklist:
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --allto format the code perfectly.cargo clippy -- -D warningsand resolved all warnings.pnpx changeset) to document my changes.